package com.longxiao.vo;

import com.longxiao.entity.Classroom;

import java.text.SimpleDateFormat;

/**
 * Created by houhongwei on 2017/5/3.
 */
public class CourseScheduleVo {

    private String tchId;
    private String startTime;
    private String endTime;
    private Integer stuCount;
    private Byte status;
    private String level;
    private Integer chapterId;
    private Integer classId;

    public CourseScheduleVo() {

    }

    public CourseScheduleVo(String tchId, String startTime, Integer stuCount, Byte status, String level, Integer chapterId, Integer classId, String endTime) {
        this.tchId = tchId;
        this.startTime = startTime;
        this.stuCount = stuCount;
        this.status = status;
        this.level = level;
        this.chapterId = chapterId;
        this.classId = classId;
        this.endTime = endTime;
    }

    public static CourseScheduleVo createTchCourseSchedule(Classroom room) {
        CourseScheduleVo vo = new CourseScheduleVo(room.getTchId(), room.getStartTime().toGMTString(), room.getStuCount(), room.getStatus(), room.getLevel(), room.getChapterId(), room.getId(), room.getEndTime().toGMTString());
        return vo;
    }


    public static CourseScheduleVo createStuCourseSchedule(Classroom room) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        CourseScheduleVo vo = new CourseScheduleVo(room.getTchId(), sdf.format(room.getStartTime()), room.getStuCount(), room.getStatus(), room.getLevel(), room.getChapterId(), room.getId(), sdf.format(room.getEndTime()));
        return vo;
    }

    @Override
    public String toString() {
        return "CourseScheduleVo{" +
                "tchId='" + tchId + '\'' +
                ", startTime='" + startTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", stuCount=" + stuCount +
                ", status=" + status +
                ", level='" + level + '\'' +
                ", chapterId=" + chapterId +
                ", classId=" + classId +
                '}';
    }

    public String getTchId() {
        return tchId;
    }

    public void setTchId(String tchId) {
        this.tchId = tchId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public Integer getStuCount() {
        return stuCount;
    }

    public void setStuCount(Integer stuCount) {
        this.stuCount = stuCount;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Integer getChapterId() {
        return chapterId;
    }

    public void setChapterId(Integer chapterId) {
        this.chapterId = chapterId;
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
}
